package com.patterns.factory.simple;

/**
 * @Author Tanyu
 * @Date 2020/6/2 10:07
 * @Description 工厂类
 * @Version 1.0
 */
public class CarFactory {

  public static Car createCar(String type) {
    if ("奥迪".equals(type)) {
      return new Audi();
    } else if ("比亚迪".equals(type)) {
      return new Byd();
    } else {
      return null;
    }
  }
}
